#pragma once
//============================================================================
// Copyright (C) 2009-2013 Brett R. Jones
//
// Issued to public domain 2013
//
// brettjones1900@gmail.com
// http://www.p2panarchy.com
//============================================================================
#include "VxDefs.h"
#include <string>

//! NOTE: also used as permission type
enum EFriendState
{
	eFriendStateIgnore		= 0,	// unknown or disabled or ignore
	eFriendStateAnonymous	= 1,	// anonymous user
	eFriendStateGuest		= 2,	// guest user
	eFriendStateFriend		= 3		// friend user
};

//! describe friend state
const char * DescribeFriendState( EFriendState eFriendState );

#pragma pack(push) 
#pragma pack(1)
class FriendMatch
{
public:
	//=== vars ===//
	U8		m_u8FriendMatch;

	//=== constructor ===//
	FriendMatch();
	//! return true if is ignored
	bool			isIgnored();
	//! return true if is Anonymous
	bool			isAnonymous();
	//! return true if is Guest
	bool			isGuest();
	//! return true if is Friend
	bool			isFriend();
	//! set my permissions to him as ignored
	void			makeIgnored();
	//! set my permissions to him as Anonymous
	void			makeAnonymous();
	//! set my permissions to him as Guest
	void			makeGuest();
	//! set my permissions to him as Friend
	void			makeFriend();
	//! wants to be friend
	bool			wantsToBeFriend();


	//! set permission level I have given to friend
	void			setMyFriendshipToHim( EFriendState eFriendState );
	//! get permission level I have given to friend
	EFriendState	getMyFriendshipToHim( void );

	//! set permission level he has given to me
	void			setHisFriendshipToMe( EFriendState eFriendState );

	//! get permission level he has given to me
	EFriendState	getHisFriendshipToMe( void );

	//! reverse the permissions
	void			reversePermissions( void );
	//! return string with friend state He has given Me
	void			describeHisFriendshipToMe( std::string & strRetPermission );
	//! return string with friend state He has given Me
	const char *	describeHisFriendshipToMe( void );
	//! return string with friend state I have given Him
	void			describeMyFriendshipToHim( std::string & strRetPermission );
	//! return string with friend state I have given Him
	const char *	describeMyFriendshipToHim( void );
};

#pragma pack(pop)